{% extends "base.html" %}
{% load i18n %}
{% block  title %}{% trans 'Periodic Task' %}{% endblock %}
{% load bootstrap3 %}
{% load static %}


{% block header-css %}
    <link href="{% static 'css/plugins/select2/select2.min.css' %}" rel="stylesheet">
    <link href="{% static 'css/plugins/jquery-datetimepicker/jquery.datetimepicker.css' %}" rel="stylesheet">
{% endblock %}

{% block page-content %}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>{% trans 'Periodic Task' %}</h2>
            <ol class="breadcrumb">
                <li>
                     <a href="/">{% trans 'Home' %}</a>
                </li>
                <li>
                    <a>{% trans 'Jobs Manage' %}</a>
                </li>
                <li class="active">
                    <strong>{% trans 'Periodic Task' %}</strong>
                </li>
            </ol>
    </div>
    <div class="col-lg-2">

    </div>
</div>


<div class="wrapper wrapper-content animated fadeInRight   ">
    <div class="row">
        <div class="col-lg-12" id="split-right">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>{% trans 'Periodic Task' %}</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="#" >{% trans 'Config Option 1' %}</a>
                            </li>
                            <li><a href="#" >{% trans 'Config Option 2' %}</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">

                    <form enctype="multipart/form-data" method="post" class="form-horizontal" action="">
                        {% csrf_token %}
                        {% if form.errors %}
                            <div class="alert alert-danger" style="margin: 20px auto 0px">
                                {{ form.errors }}
                            </div>
                        {% endif %}

                        <div class="form-group">
                            <div class="col-sm-10 col-sm-offset-0">
                                <h3>{% trans 'Group Basic Info' %}</h3>

                                {% bootstrap_field form.name layout="horizontal" %}
                                {% bootstrap_field form.scripts layout="horizontal" %}
                                {% bootstrap_field form.scheduling layout="horizontal" %}
                                {% bootstrap_field form.interval layout="horizontal" %}
                                {% bootstrap_field form.crontab  layout="horizontal" %}
                                {% bootstrap_field form.expires  layout="horizontal" %}
                                {% bootstrap_field form.enabled  layout="horizontal" %}
                                {% bootstrap_field form.asser  layout="horizontal" %}
                                {% bootstrap_field form.key  layout="horizontal" %}
                                {% bootstrap_field form.description  layout="horizontal" %}

                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">

                                {% bootstrap_button "保存" button_type="submit" button_class="btn-primary" %}

                                <a class="btn btn-white" href="{% url "jobs:crontabs_list" %}">取消</a>


                            </div>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>
</div>



{% endblock %}
{% block footer-js %}
    <script src="{% static 'js/plugins/select2/select2.full.min.js' %}"></script>
    <script src="{% static 'js/plugins/jquery-datetimepicker/jquery.datetimepicker.js' %}"></script>
    <script>
        $(document).ready(function () {
            $('.select2').select2({
                closeOnSelect: false
            });
        });
        $('#begin').datetimepicker({
        lang:'ch',
        format:'Y-m-d H:i:00',
        step:10});

        $('#end').datetimepicker({
        lang:'ch',
        format:'Y-m-d H:i:00',
        step:10});
    </script>
    {% endblock %}


